Attribute VB_Name = "CSGImportLocs"
'**Written by Jalisa Greene
'**Last Modified by Jalisa Greene
'**Last updated 6/10/2014

Sub ImportLocations()
Dim loc As Range

'**CHECK TO SEE IF LOCATIONS ALREADY IN THE ASR FIRST**'
    If Worksheets("ASR").Range("A8").Value <> "" Then
        msg = MsgBox("You cannot perform this action because you already have locations in your ASR. Please input any new locations manually from the ASR Editor.", vbOKOnly, "Action Not Allowed")
    Else:
    '**NO LOCATIONS ALREADY EXIST, GET SET TO IMPORT**'
        Worksheets("ASR").Activate
        ActiveSheet.Range("A8").Select
        lastRow = Worksheets("INV").Range("A2000").End(xlUp).Row
        For Each loc In Worksheets("INV").Range("A8", "A" & lastRow)
        '**FOR EACH SITE IN THE INVENTORY, COPY THE SITE NUMBER TO THE ASR'
            If loc.Value <> "" Then
                ActiveCell.Value = loc.Value
                ActiveCell.Offset(1).Select
            End If
        Next
        
        '**ADD SAME LOCATIONS TO THE AFFECTED ACCOUNTS LIST'
        Worksheets("Affected Account List ").Activate
        ActiveSheet.Range("A9").Select
        For Each loc In Worksheets("INV").Range("A8", "A" & lastRow)
            If loc.Value <> "" Then
                ActiveCell.Value = loc.Value
                ActiveCell.Offset(1).Select
            End If
        Next
        
        '**ADD SAME LOCATIONS TO THE SAVINGS REPORT DATA SHEET'
        Worksheets("SR Data").Activate
        ActiveSheet.Range("A9").Select
        For Each loc In Worksheets("INV").Range("A8", "A" & lastRow)
            If loc.Value <> "" Then
                ActiveCell.Value = loc.Value
                ActiveCell.Offset(1).Select
            End If
        Next
        
        Worksheets("Dashboard").Activate
        msg = MsgBox("All locations from the INV Worksheet have been added.", vbOKOnly, "Done")
    End If
End Sub
